package ${config.basePackage}.model.entity;

<#if config.swagger>
import io.swagger.v3.oas.annotations.media.Schema;
</#if>
<#if config.lombokEnabled>
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
</#if>
import org.apache.commons.lang3.builder.ToStringBuilder;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
* ${table.comment} 实体类
*
* @author ${config.author}
* @date ${.now?string("yyyy年MM月dd日 HH:mm:ss")}
* @since JDK 17
*/
<#if config.lombokEnabled>
@Data
</#if>
<#if config.swagger>
@ApiModel(value = "${table.className}", description = "${table.comment}")
</#if>
public class ${table.className}Entity implements Serializable {

    @Serial
    <#-- 生成 19 位随机数作为 serialVersionUID -->
    private static final long serialVersionUID = ${serialVersionUID}L;

<#list table.columns as column>
    /**
     * ${column.comment}
     */
    <#if config.swagger>
    @ApiModelProperty(value = "${column.comment}")
    </#if>
    private ${column.javaType} ${column.propertyName};

</#list>
<#if !config.lombokEnabled>
    <#list table.columns as column>
    public ${column.javaType} get${column.propertyName?cap_first}() {
        return ${column.propertyName};
    }

    public void set${column.propertyName?cap_first}(${column.javaType} ${column.propertyName}) {
        this.${column.propertyName} = ${column.propertyName};
    }

    </#list>
</#if>

    @Override
    public String toString() {
        return new ToStringBuilder(this)
        <#list table.columns as column>
            .append("${column.propertyName}", ${column.propertyName})
        </#list>
                .toString();
    }
}
